package com.vh.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

import org.appfuse.model.BaseObject;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

@Entity
public class Bday extends BaseObject {
	
	private static final long serialVersionUID = 1L;
	
	Long id;
	String name;
	Date occDate;
	String occType;
	String comments;
	String alertType;
	

	
	
	@Override
	public String toString() {
		return new ToStringBuilder(this).append("id", id).append("name", name)
				.append("occDate", occDate).append("occType", occType)
				.append("comments", comments).append("alertType", alertType)
				.toString();
	}
	@Override
	public boolean equals(final Object other) {
		if (!(other instanceof Bday))
			return false;
		Bday castOther = (Bday) other;
		return new EqualsBuilder().append(id, castOther.id)
				.append(name, castOther.name)
				.append(occDate, castOther.occDate)
				.append(occType, castOther.occType)
				.append(comments, castOther.comments)
				.append(alertType, castOther.alertType).isEquals();
	}
	@Override
	public int hashCode() {
		return new HashCodeBuilder().append(id).append(name).append(occDate)
				.append(occType).append(comments).append(alertType)
				.toHashCode();
	}
	
	
	@Id @GeneratedValue(strategy = GenerationType.AUTO)
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	
	@Column(name="name", length=100)
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	@Column(name="occ_date")
	public Date getOccDate() {
		return occDate;
	}
	public void setOccDate(Date occDate) {
		this.occDate = occDate;
	}
	
	@Column(length=50)
	public String getComments() {
		return comments;
	}
	public void setComments(String comments) {
		this.comments = comments;
	}
	
	/*
	 * What action to take, give a call, email etc...
	 */
	@Column(name="alert_type", length=3)
	public String getAlertType() {
		return alertType;
	}
	public void setAlertType(String alertType) {
		this.alertType = alertType;
	}
	
	/*
	 * Type of event, bday / marriage etc
	 */
	@Column(name="occ_type", length=20)
	public String getOccType() {
		return occType;
	}	
	public void setOccType(String occType) {
		this.occType = occType;
	}
	

}
